<template>
	<view class="my-usernfo">
		<!-- 头像区域 -->
		<view class="userInfo">
			<image :src="userInfo.avatarUrl" mode=""></image>
			<text>{{ userInfo.nickName }}</text>
		</view>
		<!-- 内容区域 -->
		<view class="content">
			<!-- 一区 -->
			<view class="one">
				<view class="item">
					<text>8</text>
					<text>收藏的店铺</text>
				</view>
				<view class="item">
					<text>8</text>
					<text>收藏的商品</text>
				</view>
				<view class="item">
					<text>8</text>
					<text>关注的商品</text>
				</view>
				<view class="item">
					<text>8</text>
					<text>足迹</text>
				</view>
			</view>
			<!-- 二区 -->
			<view class="two">
				<view class="top">
					我的订单
				</view>
				<view class="bot">
					<view class="item">
						<image src="../../static/tabs/icon1.png" mode=""></image>
						<text>待付款</text>
					</view>
					<view class="item">
						<image src="../../static/tabs/icon2.png" mode=""></image>
						<text>待收货</text>
					</view>
					<view class="item">
						<image src="../../static/tabs/icon3.png" mode=""></image>
						<text>退货/退款</text>
					</view>
					<view class="item">
						<image src="../../static/tabs/icon4.png" mode=""></image>
						<text>全部订单</text>
					</view>

				</view>
			</view>
			<!-- 三区 -->
			<view class="three">
				<view class="item">
					<text>收货地址</text>
					<uni-icons type="right" size="14"></uni-icons>
				</view>
				<view class="item">
					<text>联系客服</text>
					<uni-icons type="right" size="14"></uni-icons>
				</view>
				<view class="item" @click="mylogout">
					<text>退出登录</text>
					<uni-icons type="right" size="14"></uni-icons>
				</view>
			</view>
		</view>
	</view>
</template>



<script>
	import {
		mapState,
		mapMutations

	} from "vuex"

	export default {
		name: "my-userInfo",
		computed: {
			...mapState('address', ['userInfo'])
		},
		data() {
			return {

			};
		},
		methods: {
			...mapMutations('address', ['logout']),
			mylogout() {
				uni.showModal({
					title: '吊毛',
					content: '要滚蛋吗',
					success: res => {
						if (res.confirm) {
							this.logout()
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.my-usernfo {
		background-color: #f4f4f4;
		height: 100vh;

		.userInfo {
			height: 400rpx;
			background-color: #c00000;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			color: #fff;

			image {
				width: 160rpx;
				height: 160rpx;
				border-radius: 50%;
				border: 4rpx solid #fff;
				margin-bottom: 20rpx;
			}
		}

		.content {
			width: 100%;
			font-size: 12px;

			.one {
				padding: 20rpx 0;
				margin: -20rpx 20rpx 20rpx 20rpx;
				background-color: #fff;
				display: flex;
				border-radius: 3rpx;

				.item {
					flex: 1;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;

				}
			}

			.two {
				border-radius: 3rpx;
				background-color: #fff;
				margin: 0 20rpx;
				margin-bottom: 20rpx;

				.top {
					display: block;
					padding: 10rpx;
					height: 40rpx;
					line-height: 40rpx;
					border-bottom: 1px solid #f4f4f4;
				}

				.bot {
					display: flex;

					.item {
						flex: 1;
						flex-direction: 1;
						display: flex;
						flex-direction: column;
						align-items: center;
						justify-content: center;
						padding: 20rpx 0;

						image {
							width: 60rpx;
							height: 60rpx;
							margin-bottom: 5rpx;
						}
					}
				}
			}

			.three {
				margin: 0 20rpx;
				background-color: #fff;
				border-radius: 5rpx;

				.item {
					display: flex;
					justify-content: space-between;
					padding: 20rpx;
					font-size: 14px;
				}
			}
		}

	}
</style>
